
<form method="post" id="exa_project_Form" name="exaForm">
    <input type="hidden" name="project_id" value="${(po.id)!}" id="id">
    <input type="hidden" name="exa_type" value="${exa_type!}" id="exa_type">
    <input type="hidden" name="status" value="${(po.status)!}" id="status">
    <div class="easyui-tabs" style="width:100%;">
        <div title="审批补充信息">
            <table class="tableForm tableCss">
                <tr>
                    <th>项目编号：</th>
                    <td>
                        <input class="easyui-textbox" style="width:100%" name="project_code" id="project_code_ss" value="${(po.project_code!)!}" data-options="icons:[{iconCls:'icon-reload',handler: reload_handler}]">
                    </td>
                </tr>
                <tr>
                    <th>正考费用：</th>
                    <td>
                        <input class="easyui-numberbox" precision="2" style="width:100%" name="project_testing_money" id="project_testing_money" value="${(po.project_testing_money!)!}">
                    </td>
                    <th>其他费用：</th>
                    <td>
                        <input class="easyui-numberbox" precision="2" style="width:100%" name="project_other_money" id="project_other_money" value="${(po.project_other_money!)!}">
                    </td>
                </tr>
                <tr>
                    <th>单理论：</th>
                    <td>
                        <input class="easyui-numberbox" precision="2" style="width:100%" name="project_theory_money" id="project_theory_money" value="${(po.project_theory_money!)!}">
                    </td>
                    <th>单实操：</th>
                    <td>
                        <input class="easyui-numberbox" precision="2" style="width:100%" name="project_reality_money" id="project_reality_money" value="${(po.project_reality_money!)!}">
                    </td>
                </tr>
                <tr>
                    <th>理论考试时间：</th>
                    <td>
                        <input class="easyui-datebox" style="width:100%" type="text" id="project_theory_time" name="project_theory_time" value="${(po.project_theory_time!)!}" data-options="formatter:myformatter,parser:myparser" >
                    </td>
                    <th>理论考试地点：</th>
                    <td>
                        <input class="easyui-textbox" style="width:100%" name="project_theory_place" id="project_theory_place" value="${(po.project_theory_place!)!}">
                    </td>
                </tr>
                <tr>
                    <th>实操考试时间：</th>
                    <td>
                        <input class="easyui-datebox" style="width:100%" type="text" id="project_reality_time" name="project_reality_time" value="${(po.project_reality_time!)!}" data-options="formatter:myformatter,parser:myparser" >
                    </td>
                    <th>实操考试地址：</th>
                    <td>
                        <input class="easyui-textbox" style="width:100%" name="project_reality_place" id="project_reality_place" value="${(po.project_reality_place!)!}">
                    </td>
                </tr>
                <tr>
                    <th style="text-align: center" colspan="4">
                        审批意见
                    </th>
                </tr>
                <tr>
                    <td style="text-align: center" colspan="4">
                        <input class="easyui-textbox" style="width: 300px;" name="explanation" id="explanation"/>
                    </td>
                </tr>

            </table>

        </div>
        <div title="项目申请信息">
            <table class="tableForm tableCss">
                <tr>
                    <th style="width: 150px;">单位：</th>
                    <td>
                        <input class="easyui-combotree" style="width:100%" name="dep_id" id="dep_id" value="${(po.dep_id!)!}" data-options="url:'admin/department/combotree',method:'get',required:true,readonly:true">
                    </td>
                    <th style="width: 150px;">项目名称：</th>
                    <td>
                        <input class="easyui-textbox"  style="width:100%" name="project_name" id="project_name_ss" value="${(po.project_name!)!}" data-options="required:true">
                    </td>
                </tr>
                <tr>
                    <th>项目级别：</th>
                    <td>
                        <input class="easyui-combobox" style="width:100%" name="project_rank" id="project_rank" value="${(po.project_rank!)!}" data-options="url:'admin/student/sys_pa_code?table=bk_project&field=project_rank',method:'get',valueField:'id',textField:'name'" >
                    </td>
                    <th>项目类别：</th>
                    <td>
                        <input class="easyui-combobox" style="width:100%" name="project_type" id="project_type" value="${(po.project_type!)!}" data-options="url:'admin/student/sys_pa_code?table=bk_project&field=project_type',method:'get',valueField:'id',textField:'name'">
                    </td>
                </tr>
                <tr>
                    <th>计划开始时间：</th>
                    <td>
                        <input class="easyui-datebox" style="width:100%" type="text" id="project_plan_begin_time" name="project_plan_begin_time" value="${(po.project_plan_begin_time!)!}" data-options="formatter:myformatter,parser:myparser" >
                    </td>
                    <th>计划结束时间：</th>
                    <td>
                        <input class="easyui-datebox" style="width:100%" type="text" id="project_plan_end_time" name="project_plan_end_time" value="${(po.project_plan_end_time!)!}" data-options="formatter:myformatter,parser:myparser" >
                    </td>
                </tr>
                <tr>
                    <th>计划考试人数：</th>
                    <td>
                        <input class="easyui-textbox" style="width:100%" type="text" id="project_plan_user_num" name="project_plan_user_num" value="${(po.project_plan_user_num!)!}">
                    </td>
                    <th>考前培训：</th>
                    <td>
                        <input class="easyui-combobox" style="width:100%" name="project_is_training" id="project_is_training" value="${(po.project_is_training!)!}" data-options="url:'admin/student/sys_pa_code?table=common&field=boolean',method:'get',valueField:'id',textField:'name'">
                    </td>
                </tr>
                <tr>
                    <th>是否需要临时考场：</th>
                    <td>
                        <input class="easyui-combobox" style="width:100%" name="project_is_temporary_place" id="project_is_temporary_place" value="${(po.project_is_temporary_place!)!}" data-options="url:'admin/student/sys_pa_code?table=common&field=boolean',method:'get',valueField:'id',textField:'name'">
                    </td>
                    <th>备注：</th>
                    <td>
                        <input class="easyui-textbox" style="width:100%" name="memo" id="memo" value="${(po.memo!)!}">
                    </td>
                </tr>
            </table>
        </div>

        <div title="报考说明">
            <table class="tableForm tableCss">
                <tr>
                    <td style="text-align: center" colspan="4">
                        <textarea name="project_introdution" id="project_introdution" style="width:100%;height: 360px;">${(po.project_introdution!)!}</textarea>
                    </td>
                </tr>
            </table>
        </div>
</form>

        <div title="制定数据包">
            <div id="upload_div" style="padding:5px 5px; border-bottom: dashed #d2d2d2 1px;margin-bottom: 5px;">
                <form method="post" id="upload_file_form" name="upload_file_form" enctype="multipart/form-data" style="  margin-bottom:0;">
                    <input type="hidden" id="project_id" name="project_id" value="${(po.id)!}"/>
                    <input type="hidden" id="dep_id_" name="dep_id" value="${(po.dep_id)!}"/>
                    <input type="hidden" id="status_type" name="status_type" value="300"/>
                    上传文件：<input class="easyui-filebox" id="file_name" name="file_name" data-options="prompt:'选择文件',buttonText:'选择'"  style="width: 30%;">
                    <a href="javascript://" class="easyui-linkbutton" iconCls="icon-page-up" onclick="upload_file()">上传</a>
                </form>
            </div>
            <table id="project_file_list" class="easyui-datagrid" style="width:100%;height:380px"
                   rownumbers="true"
                   pagination="true"
                   pagesize="50"
                   singleSelect="true"
                   title="项目任务包"
                   title="项目任务包"
                   data-options="url:'admin/project_file/listJson?project_id=${(po.id)!}&dep_id=${(po.dep_id)!}&status_type=300',toolbar:'#upload_div'">
                <thead>
                <tr>
                    <th width="400" field="file_name" align="center">文件名</th>
                    <th width="100" field="ff" align="center" data-options="formatter:handle_button">操作</th>
                </tr>
                </thead>
            </table>
        </div>

</div>



<script>

    $(function(){
        $('#file').filebox({

        });

    })



    function myformatter(date){
        var y = date.getFullYear();
        var m = date.getMonth()+1;
        var d = date.getDate();
        return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d);
    }
    function myparser(s){
        if (!s) return new Date();
        var ss = (s.split('-'));
        var y = parseInt(ss[0],10);
        var m = parseInt(ss[1],10);
        var d = parseInt(ss[2],10);
        if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
            return new Date(y,m-1,d);
        } else {
            return new Date();
        }
    }

    function handle_button(value,row,index){
        return "<a targer='_blank' href='admin/project_file/download_file?id="+row.id+"'>下载</a>"+
                " &nbsp;&nbsp;<a href='javascript://' onclick='del_file("+row.id+")'>删除</a>";
    }

    function del_file(id){
        $.messager.confirm("警告","确定要删除吗？",function(b){
             if(b==true){
                 $.ajax({
                     type:"post",
                     url:"admin/project_file/delete_file",
                     data:{id:id},
                     dataType:"JSON",
                     success:function(data){
                         $.messager.alert("提示",data.msg);
                         if(data.success==1){
                             $("#project_file_list").datagrid("reload");
                         }
                     }
                 })
             }
        });

    }

    function reload_handler(){
            var v = $('#project_plan_begin_time').datebox('getValue');
            var name = $('#project_name_ss').textbox('getValue');
            var new_name = v.replace('-','').replace('-','');
            $("#project_code_ss").textbox("setValue",new_name+name);
    }



    function upload_file(){
        var file = $("#file_name").filebox("getValue");
        if(file==""){
            $.messager.show({
                title:'提醒',
                msg:'请选择文件',
                showType:'fade',
                style:{
                    right:'',
                    bottom:''
                }
            });
            return;
        }
        $.messager.progress({
            text:'上传中....',
            interval:100
        });

        $('#upload_file_form').form('submit',{
            url:"admin/project_file/upload_file",
            dataType:"json",
            onSubmit:function(){
                return $(this).form('enableValidation').form('validate');
            },
            success:function(data){
                $("#project_file_list").datagrid("reload");
                $("#file_name").filebox("setValue","");
                $.messager.progress('close');

            }
        });


    }
</script>
